import Vue from 'vue'
import Router from 'vue-router'

// 前台首页
import Home from './views/Home.vue'
// home的子路由
import Hindex from './views/home/hindex.vue'

// 后台登录
import Login from './views/Login.vue'
// 后台管理
import Main from './views/Main.vue'
// main的子路由
import Fupin from './views/main/Fupin.vue'
import Index from './views/main/Index.vue'
import Zhiyuanzhe from './views/main/Zhiyuanzhe.vue'
import Liuyanban from './views/main/Liuyanban.vue'
import Pinkunhu from './views/main/Pinkunhu.vue'
import User from './views/main/User.vue'
import Lunbotu from './views/main/Lunbotu.vue'
import Shoucang from './views/main/Shoucang.vue'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path:'/login',
      name:'login',
      component:Login
    },
    {
      path: '/',
      name: 'home',
      component: Home,
      redirect:'/hindex',
      children:[
        {
          path:'/hindex',
          component:Hindex
        }
      ]
    },
    {
      path: '/main',
      name: 'main',
      component: Main,
      redirect:'/index',
      children:[
        {
          path:'/index',
          name:'index',
          component:Index
        },
        {
          path:'/fupin',
          name:'fupin',
          component:Fupin
        },
        {
          path:'/zhiyuanzhe',
          name:'zhiyuanzhe',
          component:Zhiyuanzhe
        },
        {
          path:'/liuyanban',
          name:'liuyanban',
          component:Liuyanban
        },
        {
          path:'/pinkunhu',
          name:'pinkunhu',
          component:Pinkunhu
        },
        {
          path:'/user',
          name:'user',
          component:User
        },
        {
          path:'/lunbotu',
          name:'lunbotu',
          component:Lunbotu
        },
        {
          path:'/shoucang',
          name:'shoucang',
          component:Shoucang
        }
      ]
    },
   
  ]
})
